package com.sirun.cn.fca.module.main.home.temp;

import android.support.annotation.NonNull;

import com.sirun.cn.fca.module.main.home.temp.control.block.OperationBlockItem;
import com.sirun.cn.fca.module.main.home.temp.message.HomeMessageBlockItem;
import com.sirun.cn.fca.module.main.home.temp.status.HomeCarStatusItem;
import com.tencent.cloud.iov.recycler.flow.BaseRecyclerLoader;
import com.tencent.cloud.iov.recycler.item.IBlockItem;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;

public class HomeFlowLoader extends BaseRecyclerLoader implements HomeContract.Loader {

    public HomeFlowLoader() {
        super();
    }

    @NonNull
    @Override
    protected Observable<List<IBlockItem>> getDataObservable() {
        List<IBlockItem> list = new ArrayList<>();
        list.add(new HomeMessageBlockItem());
        list.add(new HomeCarStatusItem(0, 100, 1800,
                "232"));
        list.add(new OperationBlockItem("暂无数据", "时间"));
        return Observable.just(list);
//        return Observable
//                .defer(new Callable<ObservableSource<? extends List<IBlockItem>>>() {
//                    @Override
//                    public ObservableSource<? extends List<IBlockItem>> call() throws Exception {
//                        return HomeFlowLoader.super.getDataObservable();
//                    }
//                })
//                .subscribeOn(Schedulers.io());
    }


}
